Skip to content

feat(knowledge): flush pipeline hardening — open-PR dedup, checkable evidence, harvest backstop - #46

Merged
choiyounggi merged 1 commit into
mainfrom
fix/flush-hardening
Aug 6, 2026
Merged

feat(knowledge): flush pipeline hardening — open-PR dedup, checkable evidence, harvest backstop#46
choiyounggi merged 1 commit into
mainfrom
fix/flush-hardening

Conversation

@choiyounggi

Copy link
Copy Markdown
Owner

Summary

Implements every actionable item from #39, with the two real duplicate-PR pile-ups (#17#40 consolidation, #42/#43 reconcile) as the driving evidence.

Contract changes (SKILL + gate + auto-flush prompt, aligned)

  • Open-PR dedup is now part of the flush pipeline: step 2b′ lists open knowledge/* heads and diffs each candidate against them (verdict fold / drop / new); the INGEST_REPORT gains a required ## Open-PR check section the gate enforces.
  • Dedup evidence is machine-checkable: the Existing-layer check must carry Pages read: <id>, …; the gate resolves every id against the checkout's wiki/ and fails closed on fabricated ids (0 ids → deny; id not found → deny naming it; no wiki sibling → skip, global-install-safe).
  • Detection window narrowed: --title "knowledge:" now engages the gate on its own. (Full text-only closure impossible — residual documented in the gate comments.)

Harvest

  • 10-row-per-session backstop cap (the 0–3 instruction stays the policy; the cap stops a runaway session from burning a headless auto-flush run).
  • Empty session files are removed (both by the harvester on later Stops and by flush step 5 after retiring rows) — ends the empty-file accumulation.

Tests

tests/harvest.bats (12) + tests/pre-flush-pr-gate.bats (19): every new behavior observed red on the unmodified code first; full suite green; independent test-quality audit VERDICT: PASS.

Closes #39

🤖 Generated with Claude Code

…heckable evidence, harvest backstop

- INGEST_REPORT gains a required 4th section (## Open-PR check): the flush must
  diff candidates against open knowledge/* PR heads and verdict fold/drop/new,
  so sibling flushes stop piling up duplicate PRs (the #17-#40 and #42/#43
  incidents tracked in #39)
- Existing-layer evidence is now machine-checkable: a "Pages read: <ids>" line
  is required and each id is resolved against the checkout's wiki — fabricated
  page ids fail closed
- Flush detection also fires on --title "knowledge:" (bypass window narrowed)
- harvest.js: 10-row-per-session backstop cap (instruction stays 0-3) and
  removal of empty session files a flush leaves behind
- auto-flush prompt aligned to the 4-section contract; --body-file literal path
  mandated (never --body)
- tests: harvest.bats 12 cases, pre-flush-pr-gate.bats 19 cases; new behaviors
  red-first; full suite green; independent test-quality audit PASS

Closes #39

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@choiyounggi
choiyounggi merged commit 8c3426b into main Aug 6, 2026
2 checks passed
@choiyounggi
choiyounggi deleted the fix/flush-hardening branch August 6, 2026 03:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wiki-audit: knowledge pipeline hardening — gate bypass window, checkable dedup evidence, harvest caps

1 participant